package com.huiyujinrong.qiangdanbao.network;


import com.huiyujinrong.qiangdanbao.bean.BannerBean;
import com.huiyujinrong.qiangdanbao.bean.FaceEngineBean;
import com.huiyujinrong.qiangdanbao.bean.FaceFindBean;
import com.huiyujinrong.qiangdanbao.bean.FirstTradeRecord;
import com.huiyujinrong.qiangdanbao.bean.ForgetBean;
import com.huiyujinrong.qiangdanbao.bean.FragmentGrabSingleBean;
import com.huiyujinrong.qiangdanbao.bean.GrabsBean;
import com.huiyujinrong.qiangdanbao.bean.LoginBean;
import com.huiyujinrong.qiangdanbao.bean.MessageBean;
import com.huiyujinrong.qiangdanbao.bean.OderBean;
import com.huiyujinrong.qiangdanbao.bean.RecordBean;
import com.huiyujinrong.qiangdanbao.bean.RegisterBean;
import com.huiyujinrong.qiangdanbao.bean.UserInforBean;
import com.huiyujinrong.qiangdanbao.bean.UserStatusBean;
import com.huiyujinrong.qiangdanbao.bean.UserUploadBean;

import happyloan.core.RespBase;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;

public interface AppService {

    /**
     * 注册获取验证码
     *
     * @param tel
     * @return
     */
    @POST(Api.rgGetCode)
    @FormUrlEncoded
    Call<RespBase<String>> sendCode(@Field("phone") String tel, @Field("code_type") int code_type);


    /**
     * 注册
     *
     * @param tel
     * @param password
     * @param sms
     * @return
     */
    @POST(Api.register)
    @FormUrlEncoded
    Call<RespBase<RegisterBean>> register(@Field("phone") String tel, @Field("sms_code") String sms, @Field("login_pwd") String password);


    /**
     * 登录
     *
     * @param phone
     * @param login_pwd
     * @return
     */
    @POST(Api.login)
    @FormUrlEncoded
    Call<RespBase<LoginBean>> login(@Field("phone") String phone, @Field("login_pwd") String login_pwd);


    /**
     * 忘记密码
     *
     * @param phone
     * @param sms_code
     * @param new_login_pwd
     * @return
     */
    @POST(Api.forgetPwd)
    @FormUrlEncoded
    Call<RespBase<ForgetBean>> forget(@Field("phone") String phone, @Field("sms_code") String sms_code, @Field("new_login_pwd") String new_login_pwd);


    /**
     * 查询用户个人信息
     *
     * @param userId
     * @return
     */
    @POST(Api.selectUinfor)
    @FormUrlEncoded
    Call<RespBase<UserInforBean>> selectUserInfor(@Field("user_id") String userId);


    /**
     * 查询用户个人信息 状态
     *
     * @param userId
     * @return
     */
    @POST(Api.selectUserStatus)
    @FormUrlEncoded
    Call<RespBase<UserStatusBean>> selectUserStatus(@Field("user_id") String userId);


    /**
     * 提交个人信息
     *
     * @param user_id
     * @param true_name
     * @param idcard_no
     * @param organize_name
     * @param ad_code
     * @param ad_path
     * @param id_just
     * @param id_back
     * @param work_gongpai
     * @param work_mingpian
     * @return
     */
    @Multipart
    @POST(Api.uploadUinfor)
    Call<RespBase<UserUploadBean>> uploadUinfor(@Part("user_id") RequestBody user_id,
                                                @Part("true_name") RequestBody true_name,
                                                @Part("idcard_no") RequestBody idcard_no,
                                                @Part("organize_name") RequestBody organize_name,
                                                @Part("ad_code") RequestBody ad_code,
                                                @Part("ad_path") RequestBody ad_path,
                                                @Part MultipartBody.Part id_just,
                                                @Part MultipartBody.Part id_back,
                                                @Part MultipartBody.Part work_gongpai,
                                                @Part MultipartBody.Part work_mingpian);

    /**
     * 抢单列表数据
     * @param city_code 城市编码
     * @param loan_type 借款类型
     * @param page_no   页码
     * @param page_size 每页大小
     * @param loan_use  贷款用途
     * @param apply_amt 贷款金额
     * @param loan_term 贷款期限
     * @param social_security_state 社保状态
     * @param house_fund_state  公积金状态
     * @param industry_type 企业类型
     * @param license_years 营业执照年限
     * @param bank_dgls 对公流水
     * @param bank_dsls 对私流水
     * @return
     */
    @POST(Api.getGrabSingleData)
    @FormUrlEncoded
    Call<RespBase<FragmentGrabSingleBean>> getGrabSingleData(@Field("city_code") String city_code,
                                                             @Field("loan_type") String loan_type,
                                                             @Field("page_no") int page_no,
                                                             @Field("page_size") int page_size,
                                                             @Field("user_type") String user_type,
                                                             @Field("loan_use") String loan_use,
                                                             @Field("apply_amt") String apply_amt,
                                                             @Field("loan_term") String loan_term,
                                                             @Field("social_security_state") String social_security_state,
                                                             @Field("house_fund_state") String house_fund_state,
                                                             @Field("industry_type") String industry_type,
                                                             @Field("license_years") String license_years,
                                                             @Field("bank_dgls") String bank_dgls,
                                                             @Field("bank_dsls") String bank_dsls);


    /**
     * 轮播图
     *
     * @return
     */
    @POST(Api.getBannerHolder)
    Call<RespBase<BannerBean>> getBannerHolder();


    /**
     * 我的消息列表
     *
     * @return
     */
    @POST(Api.getMessageList)
    @FormUrlEncoded
    Call<RespBase<MessageBean>> getMessageList(@Field("user_id") String user_id, @Field("currentPage") int currentPage);


    /**
     * 订单 列表数据
     * @param user_id 用户ID
     * @param currentPage 页码
     * @param status 订单状态(null：全部订单；2:审核中；3:审核通过；4:审核拒绝；5:放款成功)
     * @return
     */
    @POST(Api.getOderData)
    @FormUrlEncoded
    Call<RespBase<OderBean>> getOderData(@Field("user_id") String user_id, @Field("currentPage") int currentPage,@Field("status") int status);


    /**
     * 抢单
     *
     * @param user_id
     * @param id
     * @return
     */
    @POST(Api.inQiangdan)
    @FormUrlEncoded
    Call<RespBase<String>> inQiangdan(@Field("user_id") String user_id, @Field("order_id") String id);


    /**
     * 交易记录
     *
     * @param user_id
     * @param currentPage
     * @return
     */
    @POST(Api.getRecordData)
    @Headers({"app_key: ZQXQ-HYQDB"})
    @FormUrlEncoded
    Call<RespBase<RecordBean>> getRecordData(@Field("user_id") String user_id, @Field("currentPage") int currentPage);


    /**
     * 意见反馈
     *
     * @param user_id          用户ID
     * @param feedback_content 反馈内容
     * @param image_a          文件.
     * @param image_b          文件..
     * @param image_c          文件...
     * @param image_d          文件....
     * @return
     */
    @Multipart
    @POST(Api.upLoadFeedBack)
    Call<RespBase<String>> upLoadFeedBack(@Part("user_id") RequestBody user_id,
                                          @Part("feedback_content") RequestBody feedback_content,
                                          @Part MultipartBody.Part image_a,
                                          @Part MultipartBody.Part image_b,
                                          @Part MultipartBody.Part image_c,
                                          @Part MultipartBody.Part image_d);

    @POST(Api.findUserFirstTradeRecord)
    @FormUrlEncoded
    Call<RespBase<FirstTradeRecord>> findUserFirstTradeRecord(@Field("user_id") String user_id);

    @POST(Api.findRealTimeGrab)
    Call<RespBase<GrabsBean>> findRealTimeGrab();


    /**
     * 订单状态  提交
     * @param order_id  订单ID
     * @param status    状态码 1：已发单、2：信贷经理已抢单、3：审核通过、4：审核拒绝、5：放款成功
     * @param reason    拒绝内容
     * @return
     */
    @POST(Api.submitOrderStatus)
    @FormUrlEncoded
    Call<RespBase<String>> submitOrderStatus (@Field("order_id") String order_id,
                                              @Field("status") int status,
                                              @Field("reason") String reason);
    /**
     * 查询人脸识别标志
     *
     * @param user_id
     * @return
     */

    @POST(Api.findZmxyFaceRecordByUserId)
    @FormUrlEncoded
    Call<RespBase<FaceFindBean>> findZmxyFaceRecordByUserId(@Field("user_id") String user_id);


    /**
     * 去人脸识别
     *
     * @param user_id
     * @return
     */
    @POST(Api.getZmxyFaceEngine)
    @FormUrlEncoded
    Call<RespBase<FaceEngineBean>> getZmxyFaceEngine(@Field("user_id") String user_id);
}
